package com.vains.constant;

/**
 * 全局常量
 *
 * @author vains
 * @date 2021/3/11 16:18
 */
public final class GlobalConstants {

    /**
     * 设置请求/响应为json格式编码为 utf-8
     */
    public static final String APPLICATION_JSON_UTF8 = "application/json; charset=utf-8";

    /**
     * 请求头 content-type key
     */
    public static final String HEADER_KEY_CONTENT_TYPE = "Content-Type";

    /**
     * 请求头 content-type key
     */
    public static final String HEADER_KEY_AUTHORIZATION = "Authorization";

    /**
     * 请求头 content-type key
     */
    public static final String BEFORE_REDIRECT_URI_KEY = "beforeRedirectUrl";

    /**
     * utf-8 编码
     */
    public static final String ENCODE_UTF8 = "UTF-8";

    /**
     * 处理登录的地址
     */
    public static final String LOGIN_PROCESS_URL = "/login";

    /**
     * 授权码登录地址，改地址会被重定向到登录页面
     */
    public static final String AUTHORIZATION_CODE_URI = "/oauth/authorize";

    /**
     * 重定向前缀
     */
    public static final String COMMON_REDIRECT_URL_PREV = "redirect:";

    /**
     * 鉴权白名单，在白名单上的不会被认证(或返回json)
     */
    public static final String[] AUTH_WHITE_LIST = {"/actuator/**", "/instances/**", "/swagger-ui.html", "/swagger-ui/*", "/login**", "/swagger-resources/**", "/v2/api-docs", "/v3/api-docs", "/webjars/**"};

}
